package com.chrray.position.controller.web;


import com.chrray.position.domain.FdFeedback;

import com.chrray.position.pojo.dto.BaseIdDto;
import com.chrray.position.pojo.dto.web.FdFeedBackExe;
import com.chrray.position.service.web.WFdFeedbackService;
import com.chrray.position.util.result.PageBean;
import com.chrray.position.util.result.ResponseResult;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

import static com.chrray.position.util.result.ResponseResults.PAGE;
import static com.chrray.position.util.result.ResponseResults.success;

/**
 * 意见反馈表控制器
 *
 * @author lm
 * @since 1.0.1 2024-09-02
 */
@RestController
@RequestMapping("/api/web/feedback")
@Api(tags = "意见反馈表")
@AllArgsConstructor
public class WFdFeedbackController {
    @Autowired
    private WFdFeedbackService wFdFeedbackService;

    @GetMapping("/pageList")
    @ApiOperation("列表")
    public ResponseResult<PageBean<FdFeedback>> pageCheckList(FdFeedBackExe dto) {
        return PAGE(wFdFeedbackService.pageList(dto));
    }


    @GetMapping("/selectById")
    @ApiOperation("查询详情")
    @ApiResponses({
            @ApiResponse(code=200, message = "ok", response = FdFeedback.class)
    })
    public ResponseResult<FdFeedback> selectById(BaseIdDto dto){
        return  success(wFdFeedbackService.getById(dto.getId()));
    }

    @GetMapping("/deletedById")
    @ApiOperation(" 删除")
    public ResponseResult deletedById(BaseIdDto dto){
        return  success(wFdFeedbackService.removeById(dto.getId()));
    }
}
